#ifndef QDLGGCHAT_H
#define QDLGGCHAT_H

#include <QMainWindow>
#include <QTextCharFormat>
#include "qclientsocket.h"

QT_BEGIN_NAMESPACE
namespace Ui { class QDlgGChat; }
QT_END_NAMESPACE

class QDlgGChat : public QMainWindow
{
    Q_OBJECT

public:
    //QDlgGChat(QWidget *parent = nullptr);
    QDlgGChat(quint32 userId, QString ip, QString port, QWidget *parent=nullptr);
    ~QDlgGChat();

    //add by dimon, 2024-03-17 11:48
    void init();

private slots:
    void on_btnSend_clicked();

private:
    Ui::QDlgGChat *ui;

    //add by dimon, 2024-03-16 17:13
    QString ip; //服务器IP
    QString port; //服务器端口号
    quint32 userid; //自己的userID
    QClientSocket udpSocekt;
    bool flag;
    QColor color;

private slots:
    void recvMsg();
    void currentFromatChanged(const QTextCharFormat &format);


    void on_btnClose_clicked();
    void on_coboxFont_currentFontChanged(const QFont &f);
    void on_coboxSize_currentIndexChanged(const QString &arg1);
    void on_toolbtnBold_clicked(bool checked);
    void on_toolbtnUnderline_clicked(bool checked);
    void on_toolbtnItalic_clicked(bool checked);
    void on_toolbtnColor_clicked();
};
#endif // QDLGGCHAT_H
